package com.joshua.spring.integration;

import com.joshua.spring.entity.em.AuthTypeEnum;
import lombok.Data;

import java.util.Map;

/**
 * com.joshua.spring.business.integration -- IntegrationAuthentication
 * description: 定义集成认证实体
 *
 * @author <a href="mailto:joshualwork@163.com">joshua_liu</a>
 * @date 2020/1/6 10:50
 */
@Data
public class IntegrationAuthentication {
    /**
     * 请求登录认证类型
     */
    private AuthTypeEnum authType;

    /**
     * 请求登录认证参数集合
     */
    private Map<String, String[]> authParameters;

    public String getAuthParameter(String parameter) {
        String[] values = this.authParameters.get(parameter);
        if (values != null && values.length > 0) {
            return values[0];
        }
        return null;
    }

}
